import { Modal, Table } from 'antd';

const ErrorModal = (props: { dataSource: Array<any>; onOk: () => void }) => {
  const { dataSource, onOk } = props;
  return (
    <div>
      <Modal
        title="您上传的文件以下行出现数据问题,请根据错误信息提示进行修改并重新上传"
        open={dataSource.length !== 0}
        cancelButtonProps={{ style: { display: 'none' } }}
        width={980}
        onOk={onOk}
      >
        <Table
          columns={[
            {
              title: 'excel所在行',
              dataIndex: 'row',
            },
            {
              title: '支付宝账号',
              dataIndex: 'alipayNo',
            },
            {
              title: '真实姓名',
              dataIndex: 'name',
            },
            {
              title: '打款金额',
              dataIndex: 'money',
            },
            {
              title: '错误信息',
              dataIndex: 'errMsg',
            },
          ]}
          dataSource={dataSource}
        />
      </Modal>
    </div>
  );
};

export default ErrorModal;
